<!DOCTYPE html>
<html>
    <head>
        <title>demo</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <style>
            body {
                font-family: Monospace;
                background-color: #f0f0f0;
                margin: 0px;
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <script src="https://cdn.bootcdn.net/ajax/libs/three.js/73/three.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/tween.js/0.11.0/Tween.min.js"></script>
		<script src="https://unpkg.com/three@0.73.1/examples/js/controls/TrackballControls.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/stats.js/10/Stats.min.js"></script>
        <script>

            var jsonstr = '[{"boxId":"94265910102Q830","x":-55.900002,"y":-86.250000,"z":-546.000000,"width":100.000000,"height":87.500000,"length":120.000000,"weight":45.900002,"platform":"platform25","order":1,"material":"","type":1,"place":200},{"boxId":"94265910102Q350","x":-82.400002,"y":-25.500000,"z":-579.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":6.950000,"platform":"platform25","order":2,"material":"","type":1,"place":200},{"boxId":"94265910102Q349","x":-82.400002,"y":8.500000,"z":-579.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":6.950000,"platform":"platform25","order":3,"material":"","type":1,"place":200},{"boxId":"94265910102Q348","x":-82.400002,"y":42.500000,"z":-579.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":6.950000,"platform":"platform25","order":4,"material":"","type":1,"place":200},{"boxId":"94265910102Q347","x":-82.400002,"y":76.500000,"z":-579.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":6.950000,"platform":"platform25","order":5,"material":"","type":1,"place":200},{"boxId":"94265910102Q837","x":-82.400002,"y":110.500000,"z":-579.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":6.200000,"platform":"platform25","order":6,"material":"","type":1,"place":200},{"boxId":"94265910102Q839","x":-18.900000,"y":-25.500000,"z":-579.500000,"width":33.000000,"height":34.000000,"length":60.000000,"weight":6.480000,"platform":"platform25","order":7,"material":"","type":1,"place":200},{"boxId":"94265910102Q838","x":-18.900000,"y":8.500000,"z":-579.500000,"width":33.000000,"height":34.000000,"length":60.000000,"weight":6.480000,"platform":"platform25","order":8,"material":"","type":1,"place":200},{"boxId":"94265910102Q833","x":-18.900000,"y":42.500000,"z":-579.500000,"width":33.000000,"height":34.000000,"length":60.000000,"weight":5.160000,"platform":"platform25","order":9,"material":"","type":1,"place":200},{"boxId":"94265910102Q834","x":-18.900000,"y":76.500000,"z":-579.500000,"width":33.000000,"height":34.000000,"length":60.000000,"weight":4.440000,"platform":"platform25","order":10,"material":"","type":1,"place":200},{"boxId":"94265910102Q835","x":-18.900000,"y":110.500000,"z":-579.500000,"width":33.000000,"height":34.000000,"length":60.000000,"weight":3.000000,"platform":"platform25","order":11,"material":"","type":1,"place":200},{"boxId":"94265910102Q836","x":-82.400002,"y":-25.500000,"z":-545.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":6.200000,"platform":"platform25","order":12,"material":"","type":1,"place":200},{"boxId":"94265910102Q832","x":-82.400002,"y":8.500000,"z":-545.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":5.960000,"platform":"platform25","order":13,"material":"","type":1,"place":200},{"boxId":"94265910102Q831","x":-82.400002,"y":42.500000,"z":-545.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":5.960000,"platform":"platform25","order":14,"material":"","type":1,"place":200},{"boxId":"94265910102Q351","x":-82.400002,"y":76.500000,"z":-545.000000,"width":34.000000,"height":34.000000,"length":67.000000,"weight":3.550000,"platform":"platform25","order":15,"material":"","type":1,"place":200},{"boxId":"94265910102Q842","x":-91.400002,"y":110.500000,"z":-543.500000,"width":37.000000,"height":34.000000,"length":49.000000,"weight":5.760000,"platform":"platform25","order":16,"material":"","type":1,"place":200},{"boxId":"94265910102Q840","x":-24.400000,"y":-25.500000,"z":-543.500000,"width":37.000000,"height":34.000000,"length":49.000000,"weight":4.640000,"platform":"platform25","order":17,"material":"","type":1,"place":200},{"boxId":"94265910102Q841","x":-24.400000,"y":8.500000,"z":-543.500000,"width":37.000000,"height":34.000000,"length":49.000000,"weight":3.520000,"platform":"platform25","order":18,"material":"","type":1,"place":200},{"boxId":"94265910102Q844","x":-26.400000,"y":38.000000,"z":-551.000000,"width":22.000000,"height":25.000000,"length":45.000000,"weight":3.800000,"platform":"platform25","order":19,"material":"","type":1,"place":200},{"boxId":"94265910102Q843","x":-26.400000,"y":63.000000,"z":-551.000000,"width":22.000000,"height":25.000000,"length":45.000000,"weight":3.800000,"platform":"platform25","order":20,"material":"","type":1,"place":200},{"boxId":"94265910102Q873","x":-86.400002,"y":-31.500000,"z":-512.500000,"width":25.000000,"height":22.000000,"length":59.000000,"weight":2.800000,"platform":"platform25","order":21,"material":"","type":1,"place":200},{"boxId":"94265910102Q872","x":-86.400002,"y":-9.500000,"z":-512.500000,"width":25.000000,"height":22.000000,"length":59.000000,"weight":2.800000,"platform":"platform25","order":22,"material":"","type":1,"place":200},{"boxId":"94265910102Q871","x":-86.400002,"y":12.500000,"z":-512.500000,"width":25.000000,"height":22.000000,"length":59.000000,"weight":2.800000,"platform":"platform25","order":23,"material":"","type":1,"place":200},{"boxId":"94265910102Q845","x":-86.900002,"y":30.000000,"z":-512.500000,"width":25.000000,"height":13.000000,"length":58.000000,"weight":5.850000,"platform":"platform25","order":24,"material":"","type":1,"place":200},{"boxId":"94265910102Q846","x":-86.900002,"y":43.000000,"z":-512.500000,"width":25.000000,"height":13.000000,"length":58.000000,"weight":3.270000,"platform":"platform25","order":25,"material":"","type":1,"place":200},{"boxId":"94265910102Q859","x":-10.900000,"y":-5.000000,"z":-443.000000,"width":106.000000,"height":250.000000,"length":210.000000,"weight":230.000000,"platform":"platform26","order":26,"material":"","type":1,"place":200},{"boxId":"94265910102Q858","x":-10.900000,"y":-5.000000,"z":-337.000000,"width":106.000000,"height":250.000000,"length":210.000000,"weight":230.000000,"platform":"platform26","order":27,"material":"","type":1,"place":200},{"boxId":"94265910102Q861","x":-40.900002,"y":-47.500000,"z":-243.500000,"width":81.000000,"height":165.000000,"length":150.000000,"weight":115.000000,"platform":"platform26","order":28,"material":"","type":1,"place":200},{"boxId":"94265910102Q860","x":-40.900002,"y":-47.500000,"z":-162.500000,"width":81.000000,"height":165.000000,"length":150.000000,"weight":115.000000,"platform":"platform26","order":29,"material":"","type":1,"place":200},{"boxId":"94265910102Q862","x":-40.900002,"y":-47.500000,"z":-81.500000,"width":81.000000,"height":165.000000,"length":150.000000,"weight":115.000000,"platform":"platform26","order":30,"material":"","type":1,"place":200},{"boxId":"94265920100P144","x":-94.400002,"y":43.500000,"z":-262.500000,"width":43.000000,"height":17.000000,"length":43.000000,"weight":52.500000,"platform":"platform05","order":31,"material":"","type":1,"place":100},{"boxId":"94265920100P142","x":-94.400002,"y":60.500000,"z":-262.500000,"width":43.000000,"height":17.000000,"length":43.000000,"weight":52.000000,"platform":"platform05","order":32,"material":"","type":1,"place":100},{"boxId":"94265920100P143","x":-94.400002,"y":77.500000,"z":-262.500000,"width":43.000000,"height":17.000000,"length":43.000000,"weight":52.000000,"platform":"platform05","order":33,"material":"","type":1,"place":100},{"boxId":"94265920100P141","x":-94.400002,"y":94.500000,"z":-262.500000,"width":43.000000,"height":17.000000,"length":43.000000,"weight":51.799999,"platform":"platform05","order":34,"material":"","type":1,"place":100},{"boxId":"94265910102Q127","x":-95.400002,"y":111.000000,"z":-263.500000,"width":41.000000,"height":16.000000,"length":41.000000,"weight":24.629999,"platform":"platform05","order":35,"material":"","type":1,"place":100},{"boxId":"94265910T001447","x":-44.400002,"y":54.500000,"z":-259.750000,"width":48.500000,"height":39.000000,"length":57.000000,"weight":16.520000,"platform":"platform16","order":36,"material":"","type":1,"place":200},{"boxId":"94265910T001450","x":-48.650002,"y":93.500000,"z":-255.500000,"width":48.500000,"height":39.000000,"length":57.000000,"weight":16.500000,"platform":"platform16","order":37,"material":"","type":1,"place":100},{"boxId":"94265910T001440","x":2.850000,"y":52.500000,"z":-265.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":6.160000,"platform":"platform16","order":38,"material":"","type":1,"place":100},{"boxId":"94265910T001375","x":2.850000,"y":78.750000,"z":-265.750000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":2.900000,"platform":"platform16","order":39,"material":"","type":1,"place":200},{"boxId":"94265910T001409","x":-55.900002,"y":68.250000,"z":-187.000000,"width":80.000000,"height":66.500000,"length":120.000000,"weight":93.599998,"platform":"platform16","order":40,"material":"","type":1,"place":200},{"boxId":"94265910T001439","x":-55.900002,"y":68.250000,"z":-107.000000,"width":80.000000,"height":66.500000,"length":120.000000,"weight":66.199997,"platform":"platform16","order":41,"material":"","type":1,"place":200},{"boxId":"94265910T001397","x":-88.400002,"y":112.750000,"z":-200.500000,"width":53.000000,"height":22.500000,"length":55.000000,"weight":9.040000,"platform":"platform16","order":42,"material":"","type":1,"place":200},{"boxId":"94265910T001396","x":-33.400002,"y":112.750000,"z":-200.500000,"width":53.000000,"height":22.500000,"length":55.000000,"weight":9.040000,"platform":"platform16","order":43,"material":"","type":1,"place":200},{"boxId":"94265910T001401","x":-88.400002,"y":112.750000,"z":-147.500000,"width":53.000000,"height":22.500000,"length":55.000000,"weight":8.560000,"platform":"platform16","order":44,"material":"","type":1,"place":200},{"boxId":"94265910T001415","x":-34.650002,"y":111.750000,"z":-152.750000,"width":42.500000,"height":20.500000,"length":52.500000,"weight":6.720000,"platform":"platform16","order":45,"material":"","type":1,"place":200},{"boxId":"94265910T001443","x":74.099998,"y":-88.250000,"z":-254.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":51.200001,"platform":"platform16","order":46,"material":"","type":1,"place":200},{"boxId":"94265910T001441","x":74.099998,"y":-4.750000,"z":-254.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":28.600000,"platform":"platform16","order":47,"material":"","type":1,"place":200},{"boxId":"94265910T001442","x":74.099998,"y":78.750000,"z":-254.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":28.400000,"platform":"platform16","order":48,"material":"","type":1,"place":200},{"boxId":"94265910T001449","x":62.599998,"y":-110.500000,"z":-199.750000,"width":48.500000,"height":39.000000,"length":57.000000,"weight":16.500000,"platform":"platform16","order":49,"material":"","type":1,"place":200},{"boxId":"94265910T001448","x":62.599998,"y":-71.500000,"z":-199.750000,"width":48.500000,"height":39.000000,"length":57.000000,"weight":16.000000,"platform":"platform16","order":50,"material":"","type":1,"place":200},{"boxId":"94265910T001446","x":62.599998,"y":-32.500000,"z":-199.750000,"width":48.500000,"height":39.000000,"length":57.000000,"weight":16.000000,"platform":"platform16","order":51,"material":"","type":1,"place":200},{"boxId":"94265910T001445","x":62.599998,"y":6.500000,"z":-199.750000,"width":48.500000,"height":39.000000,"length":57.000000,"weight":16.000000,"platform":"platform16","order":52,"material":"","type":1,"place":200},{"boxId":"94265910T001444","x":62.599998,"y":45.500000,"z":-199.750000,"width":48.500000,"height":39.000000,"length":57.000000,"weight":16.000000,"platform":"platform16","order":53,"material":"","type":1,"place":200},{"boxId":"94265910T001451","x":62.599998,"y":84.500000,"z":-199.750000,"width":48.500000,"height":39.000000,"length":57.000000,"weight":14.400000,"platform":"platform16","order":54,"material":"","type":1,"place":200},{"boxId":"94265910T001403","x":-55.900002,"y":-73.050003,"z":9.000000,"width":100.000000,"height":113.900002,"length":120.000000,"weight":282.600006,"platform":"platform16","order":55,"material":"","type":1,"place":200},{"boxId":"94265910T001405","x":-55.900002,"y":40.849998,"z":9.000000,"width":100.000000,"height":113.900002,"length":120.000000,"weight":281.399994,"platform":"platform16","order":56,"material":"","type":1,"place":200},{"boxId":"94265910T001413","x":-55.900002,"y":-81.150002,"z":109.000000,"width":100.000000,"height":97.699997,"length":120.000000,"weight":184.800003,"platform":"platform16","order":57,"material":"","type":1,"place":200},{"boxId":"94265910T001410","x":-55.900002,"y":16.549999,"z":109.000000,"width":100.000000,"height":97.699997,"length":120.000000,"weight":180.399994,"platform":"platform16","order":58,"material":"","type":1,"place":200},{"boxId":"94265910T001414","x":-55.900002,"y":92.699997,"z":109.000000,"width":100.000000,"height":54.599998,"length":120.000000,"weight":91.000000,"platform":"platform16","order":59,"material":"","type":1,"place":200},{"boxId":"94265910T001404","x":-55.900002,"y":-72.650002,"z":209.000000,"width":100.000000,"height":114.699997,"length":120.000000,"weight":279.799988,"platform":"platform16","order":60,"material":"","type":1,"place":200},{"boxId":"94265910T001406","x":-55.900002,"y":41.650002,"z":209.000000,"width":100.000000,"height":113.900002,"length":120.000000,"weight":278.600006,"platform":"platform16","order":61,"material":"","type":1,"place":200},{"boxId":"94265910T001407","x":-55.900002,"y":-73.699997,"z":309.000000,"width":100.000000,"height":112.599998,"length":120.000000,"weight":278.799988,"platform":"platform16","order":62,"material":"","type":1,"place":200},{"boxId":"94265910T001412","x":-55.900002,"y":32.150002,"z":309.000000,"width":100.000000,"height":99.099998,"length":120.000000,"weight":183.399994,"platform":"platform16","order":63,"material":"","type":1,"place":200},{"boxId":"94265910T001411","x":-55.900002,"y":-81.849998,"z":409.000000,"width":100.000000,"height":96.300003,"length":120.000000,"weight":182.000000,"platform":"platform16","order":64,"material":"","type":1,"place":200},{"boxId":"94265910T001408","x":-55.900002,"y":6.350000,"z":409.000000,"width":100.000000,"height":80.099998,"length":120.000000,"weight":196.800003,"platform":"platform16","order":65,"material":"","type":1,"place":200},{"boxId":"94265920100R702","x":17.150000,"y":48.049999,"z":-199.699997,"width":26.100000,"height":26.100000,"length":54.599998,"weight":3.720000,"platform":"platform09","order":66,"material":"","type":1,"place":100},{"boxId":"94265920100R701","x":17.150000,"y":48.049999,"z":-145.100006,"width":26.100000,"height":26.100000,"length":54.599998,"weight":3.720000,"platform":"platform09","order":67,"material":"","type":1,"place":100},{"boxId":"94265920100R700","x":17.150000,"y":74.150002,"z":-199.699997,"width":26.100000,"height":26.100000,"length":54.599998,"weight":3.720000,"platform":"platform09","order":68,"material":"","type":1,"place":100},{"boxId":"94265920100R699","x":17.150000,"y":74.150002,"z":-145.100006,"width":26.100000,"height":26.100000,"length":54.599998,"weight":3.720000,"platform":"platform09","order":69,"material":"","type":1,"place":100},{"boxId":"94265920100R698","x":17.150000,"y":100.250000,"z":-199.699997,"width":26.100000,"height":26.100000,"length":54.599998,"weight":3.720000,"platform":"platform09","order":70,"material":"","type":1,"place":100},{"boxId":"94265920100R697","x":17.150000,"y":100.250000,"z":-145.100006,"width":26.100000,"height":26.100000,"length":54.599998,"weight":3.720000,"platform":"platform09","order":71,"material":"","type":1,"place":100},{"boxId":"94265910102Q229","x":15.350000,"y":118.050003,"z":-208.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":2.050000,"platform":"platform09","order":72,"material":"","type":1,"place":100},{"boxId":"94265920100P145","x":15.350000,"y":118.050003,"z":-170.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":1.650000,"platform":"platform09","order":73,"material":"","type":1,"place":100},{"boxId":"94265910102Q013","x":15.350000,"y":118.050003,"z":-133.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":1.000000,"platform":"platform09","order":74,"material":"","type":1,"place":100},{"boxId":"94265910102Q220","x":15.700000,"y":47.450001,"z":-92.000000,"width":23.200001,"height":24.900000,"length":45.000000,"weight":3.860000,"platform":"platform09","order":75,"material":"","type":1,"place":100},{"boxId":"94265910102Q219","x":15.700000,"y":72.349998,"z":-92.000000,"width":23.200001,"height":24.900000,"length":45.000000,"weight":3.860000,"platform":"platform09","order":76,"material":"","type":1,"place":100},{"boxId":"94265910102Q218","x":15.700000,"y":97.250000,"z":-92.000000,"width":23.200001,"height":24.900000,"length":45.000000,"weight":3.860000,"platform":"platform09","order":77,"material":"","type":1,"place":100},{"boxId":"94265910102N636","x":55.349998,"y":114.250000,"z":-197.750000,"width":42.500000,"height":20.500000,"length":52.500000,"weight":8.250000,"platform":"platform09","order":78,"material":"","type":1,"place":100},{"boxId":"94265910102Q217","x":102.400002,"y":-117.500000,"z":-201.449997,"width":22.600000,"height":25.000000,"length":45.099998,"weight":3.940000,"platform":"platform09","order":79,"material":"","type":1,"place":100},{"boxId":"94265910102N611","x":74.099998,"y":-97.750000,"z":-111.500000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":139.500000,"platform":"platform09","order":80,"material":"","type":1,"place":100},{"boxId":"94265910102P834","x":74.099998,"y":-33.250000,"z":-111.500000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":106.000000,"platform":"platform09","order":81,"material":"","type":1,"place":100},{"boxId":"94265910102Q236","x":74.099998,"y":31.250000,"z":-111.500000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":104.000000,"platform":"platform09","order":82,"material":"","type":1,"place":100},{"boxId":"94265910102Q206","x":74.099998,"y":95.750000,"z":-111.500000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":76.500000,"platform":"platform09","order":83,"material":"","type":1,"place":100},{"boxId":"94265910102Q282","x":50.099998,"y":-77.349998,"z":5.000000,"width":92.000000,"height":105.300003,"length":92.000000,"weight":121.000000,"platform":"platform09","order":84,"material":"","type":1,"place":100},{"boxId":"94265910102Q280","x":50.099998,"y":27.950001,"z":5.000000,"width":92.000000,"height":105.300003,"length":92.000000,"weight":121.000000,"platform":"platform09","order":85,"material":"","type":1,"place":100},{"boxId":"94265910102Q163","x":43.349998,"y":99.849998,"z":-20.750000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":20.500000,"platform":"platform09","order":86,"material":"","type":1,"place":200},{"boxId":"94265910102Q159","x":43.349998,"y":99.849998,"z":19.750000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":20.500000,"platform":"platform09","order":87,"material":"","type":1,"place":200},{"boxId":"94265910102Q195","x":23.350000,"y":124.099998,"z":-23.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":5.820000,"platform":"platform09","order":88,"material":"","type":1,"place":200},{"boxId":"94265910102Q227","x":61.849998,"y":124.099998,"z":-23.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":4.180000,"platform":"platform09","order":89,"material":"","type":1,"place":200},{"boxId":"94265910102Q228","x":23.350000,"y":124.099998,"z":12.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":3.500000,"platform":"platform09","order":90,"material":"","type":1,"place":200},{"boxId":"94265920100P133","x":61.849998,"y":124.099998,"z":12.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":3.200000,"platform":"platform09","order":91,"material":"","type":1,"place":200},{"boxId":"94265920100P147","x":-96.650002,"y":125.000000,"z":76.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":3.200000,"platform":"platform09","order":92,"material":"","type":1,"place":200},{"boxId":"94265910102Q234","x":-58.150002,"y":125.000000,"z":76.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":1.300000,"platform":"platform09","order":93,"material":"","type":1,"place":200},{"boxId":"94265910102Q276","x":50.099998,"y":-77.349998,"z":105.000000,"width":92.000000,"height":105.300003,"length":92.000000,"weight":121.000000,"platform":"platform09","order":94,"material":"","type":1,"place":100},{"boxId":"94265910102Q275","x":50.099998,"y":27.950001,"z":105.000000,"width":92.000000,"height":105.300003,"length":92.000000,"weight":121.000000,"platform":"platform09","order":95,"material":"","type":1,"place":100},{"boxId":"94265910102Q232","x":34.349998,"y":102.599998,"z":78.150002,"width":38.299999,"height":44.000000,"length":60.500000,"weight":15.420000,"platform":"platform09","order":96,"material":"","type":1,"place":200},{"boxId":"94265910102Q193","x":34.349998,"y":102.599998,"z":116.449997,"width":38.299999,"height":44.000000,"length":60.500000,"weight":12.000000,"platform":"platform09","order":97,"material":"","type":1,"place":200},{"boxId":"94265910102Q194","x":83.750000,"y":102.599998,"z":89.250000,"width":38.299999,"height":44.000000,"length":60.500000,"weight":11.860000,"platform":"platform09","order":98,"material":"","type":1,"place":100},{"boxId":"94265910102P832","x":-96.400002,"y":114.099998,"z":188.500000,"width":39.000000,"height":31.000000,"length":59.000000,"weight":14.540000,"platform":"platform09","order":99,"material":"","type":1,"place":100},{"boxId":"94265910102Q222","x":-57.400002,"y":114.099998,"z":188.500000,"width":39.000000,"height":31.000000,"length":59.000000,"weight":12.300000,"platform":"platform09","order":100,"material":"","type":1,"place":100},{"boxId":"94265910102Q198","x":-18.400000,"y":114.099998,"z":188.500000,"width":39.000000,"height":31.000000,"length":59.000000,"weight":6.750000,"platform":"platform09","order":101,"material":"","type":1,"place":100},{"boxId":"94265910102Q266","x":-92.250000,"y":109.550003,"z":235.399994,"width":34.799999,"height":21.900000,"length":47.299999,"weight":6.100000,"platform":"platform09","order":102,"material":"","type":1,"place":200},{"boxId":"94265910102Q265","x":-44.950001,"y":109.550003,"z":235.399994,"width":34.799999,"height":21.900000,"length":47.299999,"weight":6.100000,"platform":"platform09","order":103,"material":"","type":1,"place":200},{"boxId":"94265910102Q269","x":50.099998,"y":-77.349998,"z":205.000000,"width":92.000000,"height":105.300003,"length":92.000000,"weight":121.000000,"platform":"platform09","order":104,"material":"","type":1,"place":100},{"boxId":"94265910102Q279","x":50.099998,"y":27.950001,"z":205.000000,"width":92.000000,"height":105.300003,"length":92.000000,"weight":120.500000,"platform":"platform09","order":105,"material":"","type":1,"place":100},{"boxId":"94265910102Q124","x":34.349998,"y":102.599998,"z":178.149994,"width":38.299999,"height":44.000000,"length":60.500000,"weight":11.800000,"platform":"platform09","order":106,"material":"","type":1,"place":200},{"boxId":"94265910102Q135","x":34.349998,"y":102.599998,"z":216.449997,"width":38.299999,"height":44.000000,"length":60.500000,"weight":11.780000,"platform":"platform09","order":107,"material":"","type":1,"place":200},{"boxId":"94265910102Q203","x":83.750000,"y":102.599998,"z":189.250000,"width":38.299999,"height":44.000000,"length":60.500000,"weight":10.140000,"platform":"platform09","order":108,"material":"","type":1,"place":100},{"boxId":"94265910102Q226","x":-55.900002,"y":101.849998,"z":299.000000,"width":80.000000,"height":40.299999,"length":120.000000,"weight":55.500000,"platform":"platform09","order":109,"material":"","type":1,"place":200},{"boxId":"94265910102Q272","x":50.099998,"y":-77.349998,"z":305.000000,"width":92.000000,"height":105.300003,"length":92.000000,"weight":120.500000,"platform":"platform09","order":110,"material":"","type":1,"place":100},{"boxId":"94265910102Q271","x":50.099998,"y":27.950001,"z":305.000000,"width":92.000000,"height":105.300003,"length":92.000000,"weight":120.500000,"platform":"platform09","order":111,"material":"","type":1,"place":100},{"boxId":"94265910102Q196","x":36.599998,"y":89.349998,"z":287.500000,"width":57.000000,"height":17.500000,"length":65.000000,"weight":9.340000,"platform":"platform09","order":112,"material":"","type":1,"place":200},{"boxId":"94265910102Q199","x":36.599998,"y":106.849998,"z":287.500000,"width":57.000000,"height":17.500000,"length":65.000000,"weight":9.280000,"platform":"platform09","order":113,"material":"","type":1,"place":200},{"boxId":"94265910102Q126","x":34.349998,"y":102.599998,"z":335.149994,"width":38.299999,"height":44.000000,"length":60.500000,"weight":8.520000,"platform":"platform09","order":114,"material":"","type":1,"place":200},{"boxId":"94265910102N637","x":83.349998,"y":92.349998,"z":334.250000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":4.400000,"platform":"platform09","order":115,"material":"","type":1,"place":200},{"boxId":"94265910102Q221","x":82.849998,"y":115.849998,"z":334.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":3.650000,"platform":"platform09","order":116,"material":"","type":1,"place":100},{"boxId":"94265910102N558","x":-85.900002,"y":88.150002,"z":399.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":92.000000,"platform":"platform09","order":117,"material":"","type":1,"place":100},{"boxId":"94265910102Q231","x":-25.900000,"y":88.150002,"z":399.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":91.500000,"platform":"platform09","order":118,"material":"","type":1,"place":100},{"boxId":"94265910102Q273","x":50.099998,"y":-77.699997,"z":405.000000,"width":92.000000,"height":104.599998,"length":92.000000,"weight":121.500000,"platform":"platform09","order":119,"material":"","type":1,"place":100},{"boxId":"94265910102Q278","x":50.099998,"y":26.900000,"z":405.000000,"width":92.000000,"height":104.599998,"length":92.000000,"weight":121.000000,"platform":"platform09","order":120,"material":"","type":1,"place":100},{"boxId":"94265910102Q161","x":42.599998,"y":103.949997,"z":397.500000,"width":77.000000,"height":49.500000,"length":77.000000,"weight":48.000000,"platform":"platform09","order":121,"material":"","type":1,"place":100},{"boxId":"94265910102Q160","x":-75.900002,"y":-97.750000,"z":519.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":60.000000,"platform":"platform09","order":122,"material":"","type":1,"place":100},{"boxId":"94265910102Q225","x":4.100000,"y":-97.750000,"z":519.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":59.000000,"platform":"platform09","order":123,"material":"","type":1,"place":100},{"boxId":"94265910102Q224","x":-75.900002,"y":-33.250000,"z":519.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":55.000000,"platform":"platform09","order":124,"material":"","type":1,"place":100},{"boxId":"94265910102Q402","x":4.100000,"y":-33.250000,"z":519.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":44.000000,"platform":"platform09","order":125,"material":"","type":1,"place":100},{"boxId":"94265910102Q400","x":-75.900002,"y":31.250000,"z":519.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":44.000000,"platform":"platform09","order":126,"material":"","type":1,"place":100},{"boxId":"94265910102Q399","x":4.100000,"y":31.250000,"z":519.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":44.000000,"platform":"platform09","order":127,"material":"","type":1,"place":100},{"boxId":"94265910102Q398","x":-75.900002,"y":95.750000,"z":519.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":43.500000,"platform":"platform09","order":128,"material":"","type":1,"place":100},{"boxId":"94265910102Q397","x":4.100000,"y":95.750000,"z":519.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":43.500000,"platform":"platform09","order":129,"material":"","type":1,"place":100},{"boxId":"94265910102Q184","x":74.099998,"y":-88.250000,"z":491.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":44.500000,"platform":"platform09","order":130,"material":"","type":1,"place":100},{"boxId":"94265910102Q396","x":74.099998,"y":-4.750000,"z":491.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":25.500000,"platform":"platform09","order":131,"material":"","type":1,"place":100},{"boxId":"94265910102Q133","x":74.099998,"y":77.650002,"z":491.000000,"width":60.000000,"height":81.300003,"length":80.000000,"weight":87.500000,"platform":"platform09","order":132,"material":"","type":1,"place":100},{"boxId":"94265910102N286","x":68.849998,"y":-105.750000,"z":555.599976,"width":49.200001,"height":48.500000,"length":49.500000,"weight":24.480000,"platform":"platform09","order":133,"material":"","type":1,"place":200},{"boxId":"94265910102N285","x":68.699997,"y":-57.250000,"z":555.750000,"width":49.200001,"height":48.500000,"length":49.500000,"weight":24.480000,"platform":"platform09","order":134,"material":"","type":1,"place":100},{"boxId":"94265910102Q223","x":62.750000,"y":-14.750000,"z":549.650024,"width":37.299999,"height":36.500000,"length":37.299999,"weight":8.260000,"platform":"platform09","order":135,"material":"","type":1,"place":100},{"boxId":"94265920100P134","x":62.849998,"y":21.000000,"z":549.750000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":10.550000,"platform":"platform09","order":136,"material":"","type":1,"place":100},{"boxId":"94265920100P146","x":62.849998,"y":47.250000,"z":549.250000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":13.900000,"platform":"platform09","order":137,"material":"","type":1,"place":200},{"boxId":"94265910102Q240","x":62.849998,"y":64.750000,"z":549.250000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":2.580000,"platform":"platform09","order":138,"material":"","type":1,"place":200}]';
			var jsonstr2 = '{"container_length":1192.000000,"container_width":231.800003,"container_height":260.000000,"container_max_load":null,"container_type_name":"40HQ"}'
            var objectArray= JSON.parse(jsonstr);
			var truckJsonObj = JSON.parse(jsonstr2);
            var container, stats;
            var camera, controls, scene, projector, renderer;
            var objects = [], plane;
            var mouse = new THREE.Vector2(), offset = new THREE.Vector3(), INTERSECTED, SELECTED; 
            init();
            animate();
            function init() {
                container = document.createElement( 'div' );
                document.body.appendChild( container );
                camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );
                camera.position.x = -600;
                camera.position.y = 400;
                camera.position.z = 1000;
                controls = new THREE.TrackballControls( camera );
                controls.rotateSpeed = 1.0;
                controls.zoomSpeed = 1.2;
                controls.panSpeed = 0.8;
                controls.noZoom = false;
                controls.noPan = true;
                controls.staticMoving = false;
                controls.dynamicDampingFactor = 0.3;
                scene = new THREE.Scene();
                var ambientLight = new THREE.AmbientLight( Math.random() *0xffffff );
                scene.add( ambientLight );
                var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
                directionalLight.position.set( 0, 1, 0 );
                scene.add( directionalLight );
                var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
                pointLight.position.set( 0, 0, -200 );
                scene.add( pointLight );

                container_length = truckJsonObj.container_length;
                container_width = truckJsonObj.container_width;
                container_height = truckJsonObj.container_height;
                var cube_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( container_width, container_height, container_length, 1,1,1 ), 
                    new THREE.MeshBasicMaterial( { color:0xefb73e, wireframe:true } )
                );
                cube_1.position.x = 0;
                cube_1.position.y = 0;
                cube_1.position.z = 0;
                scene.add( cube_1 );

                truck_head_length = 145;
                var truck_head_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( 200, 100, truck_head_length, 1, 1, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_1.position.x = 0;
                truck_head_1.position.y = -50;
                truck_head_1.position.z = -(container_length/2 + truck_head_length/2);
                scene.add( truck_head_1 );
                
                truck_head_length_2 = 80;
                var truck_head_2 = new THREE.Mesh(
                    new THREE.BoxGeometry( 170, 60, truck_head_length_2, 1, 0, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_2.position.x = 0;
                truck_head_2.position.y = 30;
                truck_head_2.position.z = -(container_length/2 + truck_head_length_2/2);
                scene.add( truck_head_2 );
                
                truck_head_chimney_radius = 7;
                var truck_head_chimney1 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney1.position.x = 100;
                truck_head_chimney1.position.y = 50;
                truck_head_chimney1.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney1 );
                
                var truck_head_chimney2 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney2.position.x = -100;
                truck_head_chimney2.position.y = 50;
                truck_head_chimney2.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney2 );
        
                var truck_wheel_1 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_1.position.x = 110;
                truck_wheel_1.position.y = -100;
                truck_wheel_1.position.z = -(container_length/2 + truck_head_length_2/2 + 20) ;
                truck_wheel_1.rotation.x = 0;
                truck_wheel_1.rotation.y = 0;
                truck_wheel_1.rotation.z = 1.6;
                scene.add( truck_wheel_1 );
                
                var truck_wheel_2 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_2.position.x = -110;
                truck_wheel_2.position.y = -100;
                truck_wheel_2.position.z = -(container_length/2 + truck_head_length_2/2 + 20);
                truck_wheel_2.rotation.x = 0;
                truck_wheel_2.rotation.y = 0;
                truck_wheel_2.rotation.z = 1.6;
                scene.add( truck_wheel_2 );

                offset_2 = -240;
                var truck_wheel_5 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_5.position.x = container_width/2 + 5;
                truck_wheel_5.position.y = -100;
                truck_wheel_5.position.z = (container_length/2 + truck_head_length_2/2 + offset_2) ;
                truck_wheel_5.rotation.x = 0;
                truck_wheel_5.rotation.y = 0;
                truck_wheel_5.rotation.z = 1.6;
                scene.add( truck_wheel_5 );

                var truck_wheel_6 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_6.position.x = -container_width/2 - 5;
                truck_wheel_6.position.y = -100;
                truck_wheel_6.position.z = (container_length/2 + truck_head_length_2/2 + offset_2);
                truck_wheel_6.rotation.x = 0;
                truck_wheel_6.rotation.y = 0;
                truck_wheel_6.rotation.z = 1.6;
                scene.add( truck_wheel_6 );

                for (var i in objectArray) {
                    if (objectArray[i].type==2) {
						var cylinderTopR = objectArray[i].length / 2;
						var cylinderHeight = objectArray[i].height;
						if (objectArray[i].place == 1 || objectArray[i].place == 2)
						{
							cylinderHeight = objectArray[i].width;
						}
						
                        var object2 = new THREE.Mesh(
						    new THREE.CylinderGeometry(cylinderTopR, cylinderTopR, cylinderHeight, 60),
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object2.position.x = objectArray[i].x;
                        object2.position.y = objectArray[i].y;
                        object2.position.z = objectArray[i].z;
                        if (objectArray[i].place==1) {
                            object2.rotation.z = 55;
                        }
                        if (objectArray[i].place==2) {
                            object2.rotation.x = 55;
                        }
                        object2.width = objectArray[i].width;
                        object2.height = objectArray[i].height;
                        object2.length = objectArray[i].length;
                        object2.weight = objectArray[i].weight;
                        object2.platform = objectArray[i].platform;
                        object2.order = objectArray[i].order;
                        object2.materialInfo = objectArray[i].material;
                        object2.boxId = objectArray[i].boxId;
                        object2.type = objectArray[i].type;
                        object2.place = objectArray[i].place;
                        scene.add( object2 );
                        objects.push( object2 );
                    }
                    if (objectArray[i].type==1) {
						if (objectArray[i].place == 200)
						{
							var box_length = objectArray[i].width;
                            var box_width = objectArray[i].length;
						}
						else
						{
							var box_length = objectArray[i].length;
							var box_width = objectArray[i].width;
						}
						var box_height = objectArray[i].height;
                        var object = new THREE.Mesh(
                            new THREE.BoxGeometry( box_width, box_height, box_length, 1, 1, 1 ), 
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object.position.x = objectArray[i].x;
                        object.position.y = objectArray[i].y;
                        object.position.z = objectArray[i].z;
						object.length = objectArray[i].length;
						object.width = objectArray[i].width;
						object.height = objectArray[i].height;
                        object.weight = objectArray[i].weight;
                        object.platform = objectArray[i].platform;
                        object.order = objectArray[i].order;
                        object.materialInfo = objectArray[i].material;
                        object.boxId = objectArray[i].boxId;
                        object.type = objectArray[i].type;
                        object.place = objectArray[i].place;
                        scene.add( object );
                        objects.push( object );
                    }
                }

                plane = new THREE.Mesh(
                    new THREE.PlaneGeometry( 2000, 2000, 8, 8 ),
                    new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } )
                );
                plane.visible = true;
                scene.add( plane );
                projector = new THREE.Projector();
                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.sortObjects = false;
                renderer.setSize( window.innerWidth, window.innerHeight );
                renderer.shadowMapEnabled = true;
                renderer.shadowMapType = THREE.PCFShadowMap;
                container.appendChild( renderer.domElement );

                stats = new Stats();
                stats.domElement.style.position = 'absolute';
                stats.domElement.style.top = '0px';
                container.appendChild( stats.domElement );

                window.addEventListener( 'resize', onWindowResize, false );
                renderer.domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
                renderer.domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
                renderer.domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
            }

            function onDocumentMouseMove( event ) {
                event.preventDefault();
                mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
                mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    if ( INTERSECTED != intersects[ 0 ].object ) {
                        INTERSECTED = intersects[ 0 ].object;
                        plane.position.copy( INTERSECTED.position );
                        plane.lookAt( camera.position );
                    }
                    container.style.cursor = 'pointer';
                } else {
                    container.style.cursor = 'auto';
                }
            }

            function onDocumentMouseDown( event ) {
                event.preventDefault();
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    controls.enabled = false;  
                    SELECTED = intersects[ 0 ].object;
                    var info = '<B>' + 
                        'boxId: ' + SELECTED.boxId +
                        '</br> x: ' + SELECTED.position.x + 
                        '</br> y: ' + SELECTED.position.y + 
                        '</br> z: ' + SELECTED.position.z + 
                        '</br> width: ' + SELECTED.width + 
                        '</br> height: ' + SELECTED.height + 
                        '</br> length: ' + SELECTED.length + 
                        '</br> weight: ' + SELECTED.weight +
                        '</br> platform: ' + SELECTED.platform +
                        '</br> order: ' + SELECTED.order +
                        '</br> material: ' + SELECTED.materialInfo + 
                        '</br> type: ' + SELECTED.type + 
                        '</br> place: ' + SELECTED.place + 
                        '</B>' +
                        '</br>' + 
                        '--------------------------' + 
                        '</br>' +
                        'type(1:箱体 2:圆柱体)' +
                        '</br>' +
                        'place(1:品字型 2:田字型)';
                    $("#objectInfo").html(info);
                }
            }

            function onDocumentMouseUp( event ) {
                event.preventDefault();
                controls.enabled = true;
                if ( INTERSECTED ) {
                    plane.position.copy( INTERSECTED.position );
                    SELECTED = null;
                }
                container.style.cursor = 'auto';
            }

            function onWindowResize() {
                camera.aspect = window.innerWidth / window.innerHeight;
                camera.updateProjectionMatrix();
                renderer.setSize( window.innerWidth, window.innerHeight );
            }

            function animate() {
                requestAnimationFrame( animate );
                render();
                stats.update();
            }

            function render() {
                controls.update();
                renderer.render( scene, camera );
            }

        </script>
        <div id="objectInfo" class="a2"><br/>点击物体获取相关属性</div>
        <style>
            .a2{position:absolute; left:20px; top:50px; bottom:0px; width:180px; height:250px; z-index:9999; background: #00FFFF; font-weight:bold; }
        </style>
    </body>
</html>